package pl.krgr.vm2.ui.actions;

import pl.krgr.vm2.ui.mocks.PersistanceMock;
import pl.vm.domain.OfficialTeam;
import pl.vm.domain.Seazon;
import pl.vm.domain.interfaces.TeamManager;

import com.opensymphony.xwork2.ActionSupport;

public class AddTeamAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	
	private String teamName;
	private String seazonId;
	
	public String execute() throws Exception {
		Seazon seazon = PersistanceMock.getSeazon(seazonId);
		TeamManager teamManager = seazon.getTeamManager();
		teamManager.addOfficialTeam(new OfficialTeam(teamName));
		return SUCCESS;
	}

	public String getTeamName() {
		return teamName;
	}

	public void setTeamName(String teamName) {
		this.teamName = teamName;
	}

	public String getSeazonId() {
		return seazonId;
	}

	public void setSeazonId(String seazonId) {
		this.seazonId = seazonId;
	}

}
